netsuite-js

SearchRecord

declaration
SearchRecord ->SearchRecord

var SearchRecord = module.exports = function SearchRecord() {
  BaseObject.call(this);

searchFields

property
this.searchFields

@member {SearchStringField[]} The search field for this search. Required.

this.searchFields = [];
};

util.inherits(SearchRecord, BaseObject);

getSOAPType

method
SearchRecord.prototype.getSOAPType()

@override

SearchRecord.prototype.getSOAPType = function() {
  // Always searchRecord
  return 'searchRecord';
};

getUnserializablePropertyNames

method
SearchRecord.prototype.getUnserializablePropertyNames()

Do not auto serialize searchFields. @see geXml

SearchRecord.prototype.getUnserializablePropertyNames = function() {
  return ['searchFields'];
};

getXml

method
SearchRecord.prototype.getXml()

node-soap doesn't set the child namespace correctly so must override all XML.

SearchRecord.prototype.getXml = function() {
  var xml = '';
  this.searchFields.forEach(function(searchField) {
    xml += '<platformCommon:' + searchField.field + ' operator="' + searchField.operator + '" xsi:type="platformCore:SearchStringField"><platformCore:searchValue>' + searchField.searchValue + '</platformCore:searchValue></platformCommon:' + searchField.field + '>';
  });

  return xml;
};